ISRO CSE 2015
Q3.
Consider the following C declaration: struct ( short x[5]; union { float y; long z; } u; )t;Assume that the objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment consideration, is:Q4.
The output of the following program is main() { static int x[] = {1,2,3,4,5,6,7,8} int i; for (i=2; i<6; ++i) x[x[i]]=x[i]; for (i=0; i<8; ++i) printf("%d", x[i]); }Q5.
Consider the following declaration: int a, *b=&a, **c=&bThe following program fragment a=4; **c=5;Q7.
The time complexity of the following C function is (assume n>0) int recursive (int n) { if(n == 1) return (1); else return (recursive (n-1) + recursive (n-1)); }Q8.
Consider the following statements #define hypotenuse (a, b) sqrt (a*a+b*b);The macro call hypotenuse(a+2,b+3);Q10.
Consider the following program fragment i=6720; j=4; while (i%j)==0 { i=i/j; j=j+1; }On termination j will have the value